package com.jurenzhao.partssystem.business.order_temporary.service;

import com.jurenzhao.partssystem.business.order_temporary.dao.AccessinfoMapper;
import com.jurenzhao.partssystem.business.order_temporary.dao.CarmodelMapper;
import com.jurenzhao.partssystem.business.order_temporary.dao.CarpiecenameMapper;
import com.jurenzhao.partssystem.business.order_temporary.dao.CarseriesMapper;
import com.jurenzhao.partssystem.business.order_temporary.entity.Accessinfo;
import com.jurenzhao.partssystem.business.order_temporary.entity.Carmodel;
import com.jurenzhao.partssystem.business.order_temporary.entity.Carpiecename;
import com.jurenzhao.partssystem.business.order_temporary.entity.Carseries;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShoppingService {

    @Resource
    private CarseriesMapper carseriesMapper;

    @Resource
    private CarmodelMapper carmodelMapper;

    @Resource
    private CarpiecenameMapper carpiecenameMapper;

    @Resource
    private AccessinfoMapper accessinfoMapper;

    public List<Carseries> list(){
        return carseriesMapper.findAll();
    }

    public List<Carmodel> modellist(String seriesId){
        return carmodelMapper.findAllBySeriesId(seriesId);
    }

    public List<Carpiecename> piecenameList(String modelNo){
        return carpiecenameMapper.findAllByModelNo(modelNo);
    }

    public List<Accessinfo> accessinfoList(String pieceNo){
        return accessinfoMapper.findAllByPieceNo(pieceNo);
    }
}
